package com.dailyblue.java.project.smbms.stock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dailyblue.java.project.smbms.stock.bean.Stock;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

@Mapper
public interface StockMapper extends BaseMapper<Stock> {
    @Select("select * from smbms_stock where bid=#{id}")
    Stock findStockById(Serializable id);

    @Update("update smbms_stock set num=num+#{num} where bid=#{bid}")
    int updateStockNum(@Param("bid") int bid, @Param("num") int num);
}
